package ExceptionAndThread.Exception;

/*
如果finally有return语句,永远返回finally中的结果,避免该情况
*/
public class Finally02 {
    public static void main(String[] args) {
        //无论是否产生异常，都会返回a
        System.out.println(method());
    }

    public static int method() {
        try {
            int a = 10;
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            int a = 100;
            return a;
        }
    }
}
